package com.showtao.common.util;

import org.codehaus.jackson.map.ObjectMapper;

public class JsonUtil {
	static ObjectMapper objectMapper;
	
	public static String toJSon(Object object) {
        if (objectMapper == null) {
            objectMapper = new ObjectMapper();
        }
        try {
            return objectMapper.writeValueAsString(object);
        } catch (Exception e) {
            e.printStackTrace();
        }
 
        return null;
    }
}
